package com.cf.user.permission.dao;

import com.cf.crud.mapper.BaseMapper;
import com.cf.user.permission.model.UserWithRole;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserWithRoleDao extends BaseMapper<UserWithRole> {
    @Select("select * from userWithRole where userId=#{userId}")
    List<UserWithRole> selectByUserId(@Param("userId") long userId);

    @Delete("delete from  userWithRole where userId=#{userId}")
    void deleteUserRole(@Param("userId") long userId);
}
